package com.tianji.learning.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tianji.learning.domain.po.LearningLesson;
import com.tianji.learning.enums.PlanStatus;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 学生课程表 Mapper 接口
 * </p>
 *
 * @author lyh
 * @since 2024-12-03
 */
public interface LearningLessonMapper extends BaseMapper<LearningLesson> {
    @Select("select sum(week_freq) from learning_lesson where user_id=#{userId} and plan_status=#{planStatus} and status!=3")
    Integer countWeekTotalPlan(@Param("userId") Long userId, @Param("planStatus") PlanStatus planStatus);

    List<LearningLesson> findExpireLesson(LocalDateTime now);
}
